package smartcampus.scjava.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import smartcampus.scjava.POJO.DO.AcademicArchives;
import smartcampus.scjava.POJO.DTO.AcademicArchivesDTO;
import smartcampus.scjava.service.AcademicArchivesService;
import smartcampus.scjava.mapper.AcademicArchivesMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 苟森
 * @description 针对表【academic_archives(学籍档案管理)】的数据库操作Service实现
 * @createDate 2023-11-14 10:47:23
 */
@Service
public class AcademicArchivesServiceImpl extends ServiceImpl<AcademicArchivesMapper, AcademicArchives>
        implements AcademicArchivesService {
    @Autowired
    AcademicArchivesMapper academicArchivesMapper;

    @Override
    public Boolean addArcheives(AcademicArchives academicArchives) {
        return academicArchivesMapper.addArcheives(academicArchives);
    }

    @Override
    public AcademicArchivesDTO selectByStuId(String stuid) {
        return academicArchivesMapper.selectByStuId(stuid);
    }

    @Override
    public Boolean delByStuId(String stuId) {
        int a = academicArchivesMapper.deleteByStuId(stuId);
        if (a >= 1) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean updateByStuId(AcademicArchives academicArchives) {
        if (academicArchivesMapper.updateByStuId(academicArchives)) {
            return true;
        } else return false;

    }

    @Override
    public List<AcademicArchivesDTO> findAll() {
        return academicArchivesMapper.findAll();
    }


}




